namespace RBAC.Read.Api.Application.Dto.DataBashboard
{
    /// <summary>
    /// 看板任务列表 DTO（用于分页查询返回）
    /// </summary>
    public class KanbanTasksListDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 工单编号
        /// </summary>
        public string WorkOrderNo { get; set; } = string.Empty;

        /// <summary>
        /// 状态（如：未开始/进行中/已完成）
        /// </summary>
        public string Status { get; set; } = string.Empty;

        /// <summary>
        /// 产品编号
        /// </summary>
        public string ProductNo { get; set; } = string.Empty;

        /// <summary>
        /// 产品名称
        /// </summary>
        public string ProductName { get; set; } = string.Empty;

        /// <summary>
        /// 产品规格
        /// </summary>
        public string ProductSpec { get; set; } = string.Empty;

        /// <summary>
        /// 工艺路线
        /// </summary>
        public string ProcessRoute { get; set; } = string.Empty;

        /// <summary>
        /// 工序编号
        /// </summary>
        public string OperationNo { get; set; } = string.Empty;

        /// <summary>
        /// 工序名称
        /// </summary>
        public string OperationName { get; set; } = string.Empty;

        /// <summary>
        /// 计划数
        /// </summary>
        public int PlannedQty { get; set; }

        /// <summary>
        /// 合格数
        /// </summary>
        public int QualifiedQty { get; set; }

        /// <summary>
        /// 不合格数
        /// </summary>
        public int UnqualifiedQty { get; set; }

        /// <summary>
        /// 完成率（计算字段：合格数/计划数）
        /// </summary>
        public double CompletionRate => PlannedQty > 0 ? (double)QualifiedQty / PlannedQty : 0;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateUser { get; set; } = string.Empty;
    }
}
